package com.subfg.common.entity.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "公用请求参数")
public class CommonParam<T> implements Serializable {

    @ApiModelProperty(value = "加密字符串, 不加密, 此字段可不传", position = 1)
    private String encryptString;
    @ApiModelProperty(value = "不加密的安全令牌, 没有代表加密数据, 有代表不加密数据", position = 2)
    private String authToken;

    @ApiModelProperty(value = "请求时携带的公告参数, 加密, 此字段不传", position = 3)
    private CommonHeadModel common;
    @ApiModelProperty(value = "自定义参数, 加密, 此段不传", position = 4)
    private T data;


    public CommonParam(String pageName, T data) {
        this.common = new CommonHeadModel(pageName);
        this.data = data;
    }
}
